#!/bin/sh
######################################################################
## This script controls bridge configuration.  It will configure the
## bridge as specified by the apcfg file
##
## ETH0 is the WAN port
## ETH1 is the LAN port
######################################################################

. /etc/ath/apcfg

brctl addbr br0
if [ "${WAN_MODE}" = "bridged" ]; then
    ifconfig $WAN_IF up
    brctl addif br0 $WAN_IF
fi
brctl addif br0 $LAN_IF
brctl setfd br0 0

ifconfig br0 $AP_IPADDR netmask $AP_NETMASK up
